<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>找回密码</title>
    <!--公共样式-->
    <link rel="stylesheet" href="css/global.css">
    <link rel="stylesheet" href="css/enroll.css">
    <script src="js/jquery-1.8.2.js"></script>
    <!--公共js-->
    <script src="js/common.js"></script>
</head>
<body>
<!--head开始-->
<div class="head">
    <!--顶头-->
    <div class="top-head">
        <div class="top-menu">
            <!--左边-->
            <div class="top-left">
                <p>客服热线: &nbsp;400-050-3015</p>
                <!--微信二维码-->
                <div class="mobile">
                    <p class="icc" id="wechat">
                        <i class="Wechat"></i>微信
                    </p>
                    <!--二维码-->
                    <div class="wecgat-rq">
                    </div>
                </div>
                <!--QQ客服-->
                <p class="icc"><a href="javascript:;" target="_blank"><i class="QQ"></i>客服</a></p>

            </div>
            <!--右边-->
            <div class="top-right">
                <a target="_blank" href="enroll-1.html">快速注册</a>
                <a target="_blank" href="login.html" class="red">立即登录</a>
                <a target="_blank" href="help-center.html">帮助中心</a>
            </div>
        </div>
    </div>
    <!--LOGO及导航-->
    <div class="top-nav">
        <a href="index.html"><div class="logo"></div></a>
        <div class="nav-list">
            <ul>
                <li><a href="index.html">首页</a></li>
                <li><a href="invest.html">投资理财</a></li>
                <li><a href="borrow-money.html">借贷专区</a></li>
                <li><a href="secure.html">安全保障</a></li>
                <li><a href="anenst.html">关于我们</a></li>
                <li><a target="_blank" href="Beginners-Guide.html">新手引导</a></li>
                <li><a href="my-account.html" class="my-cons"><i class="my-con"></i>我的账户</a></li>
            </ul>
        </div>
    </div>

</div>
<!--head结束-->
<div class="bd">
    <!--购买成功-->
    <div class="kong" style="height: 20px;"></div>
    <div class="cen-box" style="width: 1200px;height: 478px;background-color: #fff; margin: 0 auto;">
        <div class="center">
        <div class="flows"><p>找回密码</p></div>
        <!--表单-->
        <div class="form">
            <form action="index.html">
                <div class="div-ranks">
                    <label for="pas1">设置新密码</label><input type="password" id="pas1" class="infos" placeholder="至少六位以上"  />
                </div>
                <div class="div-ranks">
                    <label for="pas2">确认密码</label><input type="password" id="pas2" class="infos" placeholder="两次输入需相同"  />
                </div>
                <div class="div-pho">
                    <label for="phone">手机号码</label><input type="text" id="phone" class="infos" placeholder="请输入您注册时的手机号" />
                </div>
                <div class="div-phone">
                    <label>短信验证码</label><input type="text" id="phone-message" class="infos" placeholder="请输入验证码" />
                    <a href="javascript:;" class="send1" onclick="sends.send();">发送验证码</a>
                </div>
                <div class="div-conform">
                    <a href="javascript:;" class="conform" id="submit">确定</a>
                </div>
            </form>
        </div>
        <!--表单end-->
    </div>
    </div>
</div>

<!--footer开始-->
<div class="footer">
    <div class="foo-conter">
        <div class="foo-t">
            <div class="foo-top">
                <div class="foo-one">
                    <ul>
                        <li>
                            <a target="_blank" href="business.html">业务模式</a>
                            <a target="_blank" href="anenst.html">关于我们</a>
                        </li>
                        <li>
                            <a target="_blank" href="secure.html">安全保障</a>
                            <a target="_blank" href="help-center.html">常见问题</a>
                        </li>
                        <li>
                            <a target="_blank" href="Franchise-chain.html">连锁加盟</a>
                            <a target="_blank" href="Franchise-chain.html">合作伙伴</a>
                        </li>
                    </ul>
                </div>
                <div class="foo-two">
                    <p>客服邮箱：kefu@bjdiandaitong.com</p>
                    <p><i class="tel"></i><b>400-050-3015</b></p>
                    <p>工作日：09:00~18:00 - 节假日：09:00~18:00</p>
                </div>
                <div class="foo-three">
                    <p>微信扫一扫</p>
                    <i></i>
                </div>
            </div>
        </div>

        <div class="foo-f">
            <div class="foo-fotr">
                <p>©2015 北京市典贷通信息服务有限公司 京ICP备15026559号 &nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.cnzz.com/stat/website.php?web_id=1255410260" title="站长统计"><em class=""><img src="http://icon.cnzz.com/img/pic.gif" alt=""></em></a></p>
                <p>北京市海淀区上地国际创业园2号院一号楼17层</p>
                <p>市场有风险 投资需谨慎</p>
                <div class="certification">
                    <a href="javascript:;"><i class="cer-1" title="诚信网站"></i></a>
                    <a href="javascript:;"><i class="cer-2" title="互联网金融行业认证"></i></a>
                    <a href="javascript:;"><i class="cer-3" title="行业认证"></i></a>
                    <a href="javascript:;"><i class="cer-4" title="360网站安全监测"></i></a>
                </div>
            </div>
        </div>
    </div>
</div>
<!--footer结束-->

</body>
<script>


    $(function () {
        $("#pas1").blur(function(){//用户名文本框失去焦点触发验证事
            var pas1 = $('#pas1');
            var pas2 = $('#pas2');
            if(pas1.val() == "" || pas1.val().length < 6) {
                alert('新密码至少6位');
            }
        })
        $("#pas2").blur(function(){//用户名文本框失去焦点触发验证事
            var pas1 = $('#pas1');
            var pas2 = $('#pas2');

            if(pas1.val() != pas2.val()) {
                alert('两次不一致，请重新输入');
            }
        })
    })

    /*表单验证*/
    var sends = {
        checked:1,
        send:function(){
            var numbers = /^1\d{10}$/;
            var val = $('#phone').val().replace(/\s+/g,""); //获取输入手机号码
            if($('.div-phone').find('span').length == 0 && $('.div-phone a').attr('class') == 'send1'){
                if(!numbers.test(val) || val.length ==0) {
                    $('.div-phone').append('<span class="error">手机格式错误</span>');
                    return false;
                }
            }
            if(numbers.test(val)){
                var time = 30;
                $('.div-phone span').remove();
                function timeCountDown(){
                    if(time==0){
                        clearInterval(timer);
                        $('.div-phone a').addClass('send1').removeClass('send0').html("发送验证码");
                        sends.checked = 1;
                        return true;
                    }
                    $('.div-phone a').html(time+"S后再次发送");
                    time--;
                    return false;
                    sends.checked = 0;
                }
                $('.div-phone a').addClass('send0').removeClass('send1');
                timeCountDown();
                var timer = setInterval(timeCountDown,1000);
            }
        }
    }
    var ok2=false;
    function isCardNo(card) {
        var pattern =/^1\d{10}$/;
        return pattern.test(card);
    }
    function formValidate() {
        var str = '';

        if($.trim($('#phone').val()).length == 0) {
            str += '手机号码没有输入!\n';
            alert(str);
            $('#phone').focus();
        } else {
            if(isCardNo($.trim($('#phone').val())) == false) {
                str += '手机号不正确!\n';
                alert(str);
                $('#phone').focus();
            }
        }
        if($.trim($('#phone').val()).length == 11){
//                str += '输入成功!\n';
//                alert(str);
            $('#phone').focus();
            ok2=true;

        }
    }
    /*输入成功就跳转*/
    $('#submit').on('click', function() {
        formValidate();
        if(ok2){
            $('form').submit();
        }else{
            return false;
        }

    });
</script>
</html>